package com.coment.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum RankingType {
   score("score", "积分"),
   weekScore("weekScore", "周榜"),
   monthScore("monthScore", "月榜"),
   powerCoreNum("powerCoreNum", "能量核榜"),
   history("history", "历史（加入游戏前）"),
   current("current", "当前游戏中的数据"),
   currentGame("currentGame", "结算后的"),
   GAME_CONTRIBUTION("contribute", "贡献"),
   combatEffectiveness("combatEffectiveness", "战斗力"),
   worldFightingCapacityRaking("worldFightingCapacityRaking", "世界战力榜单");

   private final String value;
   private final String desc;

   public static RankingType fromValue(String value) {
      for(RankingType type : values()) {
         if (type.getValue().equals(value)) {
            return type;
         }
      }

      throw new IllegalArgumentException("未知的消息类型: " + value);
   }
}
